Data and their formats
cats <- data.frame(coat = c("calico", "black", "tabby"),
weight = c(2.1,5,3.2),
likes_string = c(1,0,1))
write.csv(cats, file = "~/GitHub/biol48006220_Fall2022/practcomp_2022/data/cats.csv")
cats$coat
[1] "calico" "black" "tabby"
cats$weight
[1] 2.1 5.0 3.2
cats$weight*10
[1] 21 50 32
log(cats$weight)
[1] 0.7419373 1.6094379 1.1631508
cats <- cbind(cats, logweight)
paste("My cat is ", cats$coat, ", and it weighs ", cats$weight, " kg.", sep = "")
[1] "My cat is calico, and it weighs 2.1 kg." "My cat is black, and it weighs 5 kg."
[3] "My cat is tabby, and it weighs 3.2 kg."
Data Types
typeof(cats$coat)
[1] "character"
typeof(cats$weight)
[1] "double"
typeof(cats$likes_string)
[1] "double"
typeof(3.14159)
[1] "double"
typeof(1i)
[1] "complex"
typeof(FALSE)
[1] "logical"
typeof(T)
[1] "logical"
typeof(cats)
[1] "list"
class(cats)
[1] "data.frame"
file.show("./data/cats.csv")
typeof(cats$likes_string)
[1] "logical"
cats$likes_string
[1] TRUE FALSE TRUE
c("a", "b")
[1] "a" "b"
ab
[1] "a" "b"
c(ab, "c")
[1] "a" "b" "c"
c(ab, ab)
[1] "a" "b" "a" "b"
1:10
[1] 1 2 3 4 5 6 7 8 9 10
seq(10)
[1] 1 2 3 4 5 6 7 8 9 10
head(z, n=3)
[1] 1 2 3
length(z)
[1] 10
class(z)
[1] "integer"
typeof(z)
[1] "integer"
seq(0,100, by=5)
[1] 0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100
Data Frames
str(cats$coat)
chr [1:3] "calico" "black" "tabby"
coats
[1] "tabby" "tortoiseshell" "tortoiseshell" "black" "tabby"
str(coats)
chr [1:5] "tabby" "tortoiseshell" "tortoiseshell" "black" "tabby"
factor(coats)
[1] tabby tortoiseshell tortoiseshell black tabby
Levels: black tabby tortoiseshell
class(categories)
[1] "factor"
str(categories)
Factor w/ 3 levels "black","tabby",..: 2 3 3 1 2
Lists
list_example <- list(title="Numbers", numbers = 1:10, data=T)
list_example
$title
[1] "Numbers"
$numbers
[1] 1 2 3 4 5 6 7 8 9 10
$data
[1] TRUE
another_list
[[1]]
[1] 1
[[2]]
[1] "a"
[[3]]
[1] TRUE
[[4]]
[1] 1+1i
class(list_example)
[1] "list"
class(cats)
[1] "data.frame"
Matrices
# By definition, matrices are all numbers
matrix_example <- matrix(0, ncol = 5, nrow = 3)
matrix_example
class(matrix_example)
typeof(matrix_example)
str(matrix_example)
dim(matrix_example)
ncol(matrix_example)
nrow(matrix_example)
class(data.frame(matrix_example))
df_example <- data.frame(matrix_example)
df_example
Subsetting
p <- c(2.3, 6.9, 4.0, 23, 1)
p
names(p) <- c('a', 'b', 'c', 'd', 'e')
p
p[1]
p[2:4]
p[c(1,5)]
p[c(1,1,1,3,5,5)]
p[6]
p[-3]
p[c(-1,-5)]
p[-(2:4)]
p[c('a','c')]
p[c(T,F,T,F,T)]
p[names(p) != 'c']
Factors
f <- factor(c('a','b','c','d','e'))
f
f[f=='a']
f[1:3]
f[f %in% c('b','c')]
f[-3]
f2 <- factor(c('a','a','d','c','c'))
f2
f2[f2 == 'a']
f2[f2 %in% c('a','c')]
Matrices Resumed
m
[,1] [,2] [,3] [,4]
[1,] -1.1968205 -0.3943568 0.4232027 -2.34367583
[2,] -0.9516674 -1.2484030 -1.8461725 -0.77605977
[3,] 0.2786364 -0.6521289 -0.2456747 -2.16173144
[4,] -1.4449411 -1.1707346 1.2538299 0.05701057
[5,] 0.8216518 0.3604497 1.5633419 -0.24867199
[6,] 1.2470188 1.2302708 -1.2644661 -0.07830796
m[,c(3,4)]
[,1] [,2]
[1,] 0.4232027 -2.34367583
[2,] -1.8461725 -0.77605977
[3,] -0.2456747 -2.16173144
[4,] 1.2538299 0.05701057
[5,] 1.5633419 -0.24867199
[6,] -1.2644661 -0.07830796
Lists Revisted
xlist
$a
[1] "BIOL48006220"
$b
[1] 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0
$data
[1] "Grade"
xlist[1:2]
$a
[1] "BIOL48006220"
$b
[1] 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0
xlist['a']
$a
[1] "BIOL48006220"
xlist[['a']]
[1] "BIOL48006220"
xlist[['b']]
[1] 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0
xlist$b
[1] 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0
Data Frames Revisted
gp <- read.csv("/Users/colinfinlay/GitHub/biol48006220_Fall2022/practcomp_2022/data/forest_area_sq_km.numbers")
Warning: line 1 appears to contain embedded nullsWarning: line 3 appears to contain embedded nullsWarning: line 4 appears to contain embedded nullsWarning: line 5 appears to contain embedded nullsWarning: EOF within quoted stringWarning: embedded nul(s) found in input
head(gp, n=10L)
Warning messages:
1: replacing previous import ‘lifecycle::last_warnings’ by ‘rlang::last_warnings’ when loading ‘tibble’
2: replacing previous import ‘lifecycle::last_warnings’ by ‘rlang::last_warnings’ when loading ‘pillar’
nrow(gp)
[1] 214
head(gp[["country"]], 10L)
[1] "Aruba" "Afghanistan" "Angola" "Albania" "Andorra"
[6] "United Arab Emirates" "Argentina" "Armenia" "American Samoa" "Antigua and Barbuda"
gp$X2001
[1] "4.2" "12.1k" "766k" "7720" "160" "3110" "327k" "3320" "177" "93.2" "1.31M" "38.4k" "9960" "1940" "6720"
[16] "40.4k" "71.2k" "19.1k" "34.5k" "4" "5100" "21.1k" "83.4k" "14.5k" "10" "547k" "5.43M" "63" "3940" "26.3k"
[31] "174k" "228k" "3.48M" "8.68" "12k" "160k" "1.82M" "48.7k" "215k" "1.43M" "222k" "623k" "408" "403" "28.6k"
[46] "25.3k" "129" "1720" "26.4k" "114k" "56" "479" "5750" "19.9k" "16.5k" "136k" "605" "11.1k" "174k" "22.6k"
[61] "184k" "224k" "10.2k" "155k" "0.8" "639" "237k" "34.6" "29.8k" "27.7k" "86.7k" "0" "68.6k" "3460" "21.3k"
[76] "26k" "36.6k" "177" "2.2" "41.1k" "240" "186k" "67.4k" "18.9k" "3800" "19.5k" "1.01M" "680k" "6480" "96k"
[91] "8190" "328" "1530" "85k" "5280" "975" "249k" "31.4k" "38.9k" "11.9k" "107k" "11.8" "110" "64.6k" "51.3"
[106] "173k" "1380" "81.6k" "2170" "210" "67" "21.5k" "345" "20.5k" "871" "32.7k" "10" "55.4k" "0" "3500"
[121] "129k" "8.2" "681k" "94" "9580" "133k" "3.5" "342k" "6260" "142k" "316" "407k" "4110" "412" "30k"
[136] "195k" "79.2k" "8380" "13k" "246k" "51.6k" "3620" "" "121k" "58.2k" "0" "98.5k" "30" "44.3k" "44.2k"
[151] "750k" "72.2k" "398" "363k" "91.1k" "4420" "64.1k" "32.8k" "223k" "91.2" "1490" "0" "64k" "8.1M" "2830"
[166] "9770" "" "87.8k" "172" "25.4k" "28.9k" "6650" "10" "73.6k" "24.8k" "" "583" "153k" "19k" "12.4k"
[181] "281k" "4760" "" "337" "4440" "105" "61.9k" "12.6k" "192k" "4100" "41.3k" "9460" "89.5" "2360" "6720"
[196] "203k" "10" "529k" "30.8k" "95.2k" "14.4k" "3.05M" "30.4k" "285" "488k" "36.6" "201" "121k" "4420" "1700"
[211] "5490" "177k" "470k" "183k"
Conditionals and Flow
if (n<10) {
print("n is less than 10")
} else if (n>10) {
print("n is greater than 10")
} else {
print("n is equal to 10")
}
[1] "n is equal to 10"
for (n in seq(1,20)) {
if (n<10) {
print("n is less than 10")
} else if (n>10) {
print("n is greater than 10")
} else {
print("n is equal to 10")
}
}
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is less than 10"
[1] "n is equal to 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
[1] "n is greater than 10"
while (g <=10) {
print(paste(g, "is less than or equal to 10"))
g <- g+1
}
[1] "0 is less than or equal to 10"
[1] "1 is less than or equal to 10"
[1] "2 is less than or equal to 10"
[1] "3 is less than or equal to 10"
[1] "4 is less than or equal to 10"
[1] "5 is less than or equal to 10"
[1] "6 is less than or equal to 10"
[1] "7 is less than or equal to 10"
[1] "8 is less than or equal to 10"
[1] "9 is less than or equal to 10"
[1] "10 is less than or equal to 10"
Plotting
library(ggplot2)







africas <- gapminder[gapminder$continent=="Africa", ]
ggplot(data=africas, mapping = aes(x=year, y=lifeExp)) +
geom_line() +
facet_wrap(~country) +
theme(axis.text.x = element_text(angle = 90)) +
labs(
x = "Year",
y = "Life Expectancy",
title = "Life Expectancy Over Time in African Countries"
)

ggsave(filename = "./data/AfricanLifeExp.png", plot = AfricanLifeExp, width = 24, height = 40, dpi = 300, units = "cm")
Error in grDevices::dev.off() :
QuartzBitmap_Output - unable to open file './data/AfricanLifeExp.png'
pdf(file = "/Users/colinfinlay/GitHub/biol48006220_Fall2022/practcomp_2022/results/AfricanLifeExp.pdf", width = 24, height = 40)
plot(AfricanLifeExp)
dev.off()
null device
1
write.table(gapminder, file="/data/gapminder_web.csv", sep = ",")
Warning: cannot open file '/data/gapminder_web.csv': No such file or directoryError in file(file, ifelse(append, "a", "w")) :
cannot open the connection
write.csv(africas, file="/Users/colinfinlay/GitHub/biol48006220_Fall2022/practcomp_2022/data/gapminder_web_africas.csv")
Fancy Plots
install.packages(c("ggridges", "viridis", "hrbrthemes"), dependencies = T)
also installing the dependencies ‘deldir’, ‘lazyeval’, ‘png’, ‘jpeg’, ‘interp’, ‘rex’, ‘sp’, ‘terra’, ‘latticeExtra’, ‘systemfonts’, ‘extrafontdb’, ‘Rttf2pt1’, ‘covr’, ‘patchwork’, ‘ggplot2movies’, ‘vdiffr’, ‘hexbin’, ‘dichromat’, ‘raster’, ‘rasterVis’, ‘mapproj’, ‘svglite’, ‘rgdal’, ‘maps’, ‘extrafont’, ‘gdtools’, ‘hunspell’, ‘gcookbook’
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/deldir_1.0-6.tgz'
Content type 'application/x-gzip' length 302125 bytes (295 KB)
==================================================
downloaded 295 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/lazyeval_0.2.2.tgz'
Content type 'application/x-gzip' length 157457 bytes (153 KB)
==================================================
downloaded 153 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/png_0.1-7.tgz'
Content type 'application/x-gzip' length 369727 bytes (361 KB)
==================================================
downloaded 361 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/jpeg_0.1-9.tgz'
Content type 'application/x-gzip' length 416927 bytes (407 KB)
==================================================
downloaded 407 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/interp_1.1-3.tgz'
Content type 'application/x-gzip' length 5406572 bytes (5.2 MB)
==================================================
downloaded 5.2 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/rex_1.2.1.tgz'
Content type 'application/x-gzip' length 122412 bytes (119 KB)
==================================================
downloaded 119 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/sp_1.5-0.tgz'
Content type 'application/x-gzip' length 1834165 bytes (1.7 MB)
==================================================
downloaded 1.7 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/terra_1.6-17.tgz'
Content type 'application/x-gzip' length 96245728 bytes (91.8 MB)
==================================================
downloaded 91.8 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/latticeExtra_0.6-30.tgz'
Content type 'application/x-gzip' length 2204020 bytes (2.1 MB)
==================================================
downloaded 2.1 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/systemfonts_1.0.4.tgz'
Content type 'application/x-gzip' length 5879392 bytes (5.6 MB)
==================================================
downloaded 5.6 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/extrafontdb_1.0.tgz'
Content type 'application/x-gzip' length 6987 bytes
==================================================
downloaded 6987 bytes
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/Rttf2pt1_1.3.11.tgz'
Content type 'application/x-gzip' length 106028 bytes (103 KB)
==================================================
downloaded 103 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/covr_3.6.1.tgz'
Content type 'application/x-gzip' length 325440 bytes (317 KB)
==================================================
downloaded 317 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/patchwork_1.1.2.tgz'
Content type 'application/x-gzip' length 3235669 bytes (3.1 MB)
==================================================
downloaded 3.1 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/ggplot2movies_0.0.1.tgz'
Content type 'application/x-gzip' length 1248034 bytes (1.2 MB)
==================================================
downloaded 1.2 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/vdiffr_1.0.4.tgz'
Content type 'application/x-gzip' length 1070374 bytes (1.0 MB)
==================================================
downloaded 1.0 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/hexbin_1.28.2.tgz'
Content type 'application/x-gzip' length 1471267 bytes (1.4 MB)
==================================================
downloaded 1.4 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/dichromat_2.0-0.1.tgz'
Content type 'application/x-gzip' length 146933 bytes (143 KB)
==================================================
downloaded 143 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/raster_3.6-3.tgz'
Content type 'application/x-gzip' length 4771584 bytes (4.6 MB)
==================================================
downloaded 4.6 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/rasterVis_0.51.2.tgz'
Content type 'application/x-gzip' length 212016 bytes (207 KB)
==================================================
downloaded 207 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/mapproj_1.2.8.tgz'
Content type 'application/x-gzip' length 83346 bytes (81 KB)
==================================================
downloaded 81 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/svglite_2.1.0.tgz'
Content type 'application/x-gzip' length 918168 bytes (896 KB)
==================================================
downloaded 896 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/rgdal_1.5-32.tgz'
Content type 'application/x-gzip' length 86550225 bytes (82.5 MB)
==================================================
downloaded 82.5 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/maps_3.4.0.tgz'
Content type 'application/x-gzip' length 3105764 bytes (3.0 MB)
==================================================
downloaded 3.0 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/extrafont_0.18.tgz'
Content type 'application/x-gzip' length 54152 bytes (52 KB)
==================================================
downloaded 52 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/gdtools_0.2.4.tgz'
Content type 'application/x-gzip' length 1921424 bytes (1.8 MB)
==================================================
downloaded 1.8 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/hunspell_3.0.2.tgz'
Content type 'application/x-gzip' length 2473165 bytes (2.4 MB)
==================================================
downloaded 2.4 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/gcookbook_2.0.tgz'
Content type 'application/x-gzip' length 4012352 bytes (3.8 MB)
==================================================
downloaded 3.8 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/ggridges_0.5.4.tgz'
Content type 'application/x-gzip' length 2254162 bytes (2.1 MB)
==================================================
downloaded 2.1 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/viridis_0.6.2.tgz'
Content type 'application/x-gzip' length 2998780 bytes (2.9 MB)
==================================================
downloaded 2.9 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/hrbrthemes_0.8.0.tgz'
Content type 'application/x-gzip' length 2291025 bytes (2.2 MB)
==================================================
downloaded 2.2 MB
The downloaded binary packages are in
/var/folders/r1/3zp0c6w516g61fbl6pqcz7gr0000gn/T//RtmpKhjam5/downloaded_packages
hrbrthemes::import_roboto_condensed()
sh: line 1: 1576 Segmentation fault: 11 '/Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rttf2pt1/exec//ttf2pt1' -a -GfAe '/Library/Frameworks/R.framework/Versions/4.2/Resources/library/hrbrthemes/fonts/roboto-condensed/RobotoCondensed-Bold.ttf' '/var/folders/r1/3zp0c6w516g61fbl6pqcz7gr0000gn/T//RtmpKhjam5/fonts/RobotoCondensed-Bold' 2>&1
sh: line 1: 1578 Segmentation fault: 11 '/Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rttf2pt1/exec//ttf2pt1' -a -GfAe '/Library/Frameworks/R.framework/Versions/4.2/Resources/library/hrbrthemes/fonts/roboto-condensed/RobotoCondensed-Light.ttf' '/var/folders/r1/3zp0c6w516g61fbl6pqcz7gr0000gn/T//RtmpKhjam5/fonts/RobotoCondensed-Light' 2>&1
sh: line 1: 1580 Segmentation fault: 11 '/Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rttf2pt1/exec//ttf2pt1' -a -GfAe '/Library/Frameworks/R.framework/Versions/4.2/Resources/library/hrbrthemes/fonts/roboto-condensed/RobotoCondensed-Regular.ttf' '/var/folders/r1/3zp0c6w516g61fbl6pqcz7gr0000gn/T//RtmpKhjam5/fonts/RobotoCondensed-Regular' 2>&1
You will likely need to install these fonts on your system as well.
You can find them in [/Library/Frameworks/R.framework/Versions/4.2/Resources/library/hrbrthemes/fonts/roboto-condensed]
Statistics
install.packages(c("ggstatsplot", "palmerpenguins"), dependencies = T)
also installing the dependencies ‘listenv’, ‘parallelly’, ‘future’, ‘globals’, ‘future.apply’, ‘progressr’, ‘SQUAREM’, ‘checkmate’, ‘matrixStats’, ‘RcppGSL’, ‘lava’, ‘elliptic’, ‘contfrac’, ‘deSolve’, ‘Brobdingnag’, ‘inline’, ‘loo’, ‘pkgbuild’, ‘bdsmatrix’, ‘RcppZiggurat’, ‘iterators’, ‘rngtools’, ‘prodlim’, ‘bayestestR’, ‘prismatic’, ‘effectsize’, ‘zeallot’, ‘lmerTest’, ‘coda’, ‘hypergeo’, ‘bridgesampling’, ‘LaplacesDemon’, ‘logspline’, ‘RcppParallel’, ‘rstan’, ‘rstantools’, ‘BH’, ‘StanHeaders’, ‘metadat’, ‘mathjaxr’, ‘bbmle’, ‘fastGHQuad’, ‘Rfast’, ‘doParallel’, ‘foreach’, ‘doRNG’, ‘gmp’, ‘Rmpfr’, ‘SuppDists’, ‘kSamples’, ‘BWStest’, ‘mnormt’, ‘commonmark’, ‘reshape’, ‘mc2d’, ‘gower’, ‘hardhat’, ‘ipred’, ‘timeDate’, ‘correlation’, ‘datawizard’, ‘insight’, ‘paletteer’, ‘parameters’, ‘performance’, ‘statsExpressions’, ‘afex’, ‘BayesFactor’, ‘gapminder’, ‘ggcorrplot’, ‘ggside’, ‘metaBMA’, ‘metafor’, ‘metaplus’, ‘PMCMRplus’, ‘psych’, ‘spelling’, ‘WRS2’, ‘recipes’
There is a binary version available but the source version is later:
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/listenv_0.8.0.tgz'
Content type 'application/x-gzip' length 103223 bytes (100 KB)
==================================================
downloaded 100 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/parallelly_1.32.1.tgz'
Content type 'application/x-gzip' length 302748 bytes (295 KB)
==================================================
downloaded 295 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/future_1.28.0.tgz'
Content type 'application/x-gzip' length 656510 bytes (641 KB)
==================================================
downloaded 641 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/globals_0.16.1.tgz'
Content type 'application/x-gzip' length 106135 bytes (103 KB)
==================================================
downloaded 103 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/future.apply_1.9.1.tgz'
Content type 'application/x-gzip' length 151535 bytes (147 KB)
==================================================
downloaded 147 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/progressr_0.11.0.tgz'
Content type 'application/x-gzip' length 272289 bytes (265 KB)
==================================================
downloaded 265 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/SQUAREM_2021.1.tgz'
Content type 'application/x-gzip' length 176568 bytes (172 KB)
==================================================
downloaded 172 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/checkmate_2.1.0.tgz'
Content type 'application/x-gzip' length 694554 bytes (678 KB)
==================================================
downloaded 678 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/matrixStats_0.62.0.tgz'
Content type 'application/x-gzip' length 590827 bytes (576 KB)
==================================================
downloaded 576 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/RcppGSL_0.3.11.tgz'
Content type 'application/x-gzip' length 1051782 bytes (1.0 MB)
==================================================
downloaded 1.0 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/elliptic_1.4-0.tgz'
Content type 'application/x-gzip' length 1257923 bytes (1.2 MB)
==================================================
downloaded 1.2 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/contfrac_1.1-12.tgz'
Content type 'application/x-gzip' length 27492 bytes (26 KB)
==================================================
downloaded 26 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/deSolve_1.34.tgz'
Content type 'application/x-gzip' length 2619125 bytes (2.5 MB)
==================================================
downloaded 2.5 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/Brobdingnag_1.2-9.tgz'
Content type 'application/x-gzip' length 1325577 bytes (1.3 MB)
==================================================
downloaded 1.3 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/inline_0.3.19.tgz'
Content type 'application/x-gzip' length 127274 bytes (124 KB)
==================================================
downloaded 124 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/loo_2.5.1.tgz'
Content type 'application/x-gzip' length 1589173 bytes (1.5 MB)
==================================================
downloaded 1.5 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/pkgbuild_1.3.1.tgz'
Content type 'application/x-gzip' length 143896 bytes (140 KB)
==================================================
downloaded 140 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/bdsmatrix_1.3-6.tgz'
Content type 'application/x-gzip' length 327026 bytes (319 KB)
==================================================
downloaded 319 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/RcppZiggurat_0.1.6.tgz'
Content type 'application/x-gzip' length 789626 bytes (771 KB)
==================================================
downloaded 771 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/iterators_1.0.14.tgz'
Content type 'application/x-gzip' length 345398 bytes (337 KB)
==================================================
downloaded 337 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/rngtools_1.5.2.tgz'
Content type 'application/x-gzip' length 76743 bytes (74 KB)
==================================================
downloaded 74 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/prodlim_2019.11.13.tgz'
Content type 'application/x-gzip' length 422363 bytes (412 KB)
==================================================
downloaded 412 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/bayestestR_0.13.0.tgz'
Content type 'application/x-gzip' length 1477700 bytes (1.4 MB)
==================================================
downloaded 1.4 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/prismatic_1.1.1.tgz'
Content type 'application/x-gzip' length 786489 bytes (768 KB)
==================================================
downloaded 768 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/effectsize_0.8.1.tgz'
Content type 'application/x-gzip' length 680142 bytes (664 KB)
==================================================
downloaded 664 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/zeallot_0.1.0.tgz'
Content type 'application/x-gzip' length 57961 bytes (56 KB)
==================================================
downloaded 56 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/lmerTest_3.1-3.tgz'
Content type 'application/x-gzip' length 529283 bytes (516 KB)
==================================================
downloaded 516 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/coda_0.19-4.tgz'
Content type 'application/x-gzip' length 321854 bytes (314 KB)
==================================================
downloaded 314 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/hypergeo_1.2-13.tgz'
Content type 'application/x-gzip' length 352373 bytes (344 KB)
==================================================
downloaded 344 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/bridgesampling_1.1-2.tgz'
Content type 'application/x-gzip' length 1723346 bytes (1.6 MB)
==================================================
downloaded 1.6 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/LaplacesDemon_16.1.6.tgz'
Content type 'application/x-gzip' length 4045413 bytes (3.9 MB)
==================================================
downloaded 3.9 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/logspline_2.1.17.tgz'
Content type 'application/x-gzip' length 272278 bytes (265 KB)
==================================================
downloaded 265 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/RcppParallel_5.1.5.tgz'
Content type 'application/x-gzip' length 612423 bytes (598 KB)
==================================================
downloaded 598 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/rstan_2.21.7.tgz'
Content type 'application/x-gzip' length 24545266 bytes (23.4 MB)
==================================================
downloaded 23.4 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/rstantools_2.2.0.tgz'
Content type 'application/x-gzip' length 155838 bytes (152 KB)
==================================================
downloaded 152 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/BH_1.78.0-0.tgz'
Content type 'application/x-gzip' length 12587148 bytes (12.0 MB)
==================================================
downloaded 12.0 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/StanHeaders_2.21.0-7.tgz'
Content type 'application/x-gzip' length 1546843 bytes (1.5 MB)
==================================================
downloaded 1.5 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/metadat_1.2-0.tgz'
Content type 'application/x-gzip' length 835673 bytes (816 KB)
==================================================
downloaded 816 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/mathjaxr_1.6-0.tgz'
Content type 'application/x-gzip' length 819566 bytes (800 KB)
==================================================
downloaded 800 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/bbmle_1.0.25.tgz'
Content type 'application/x-gzip' length 894088 bytes (873 KB)
==================================================
downloaded 873 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/fastGHQuad_1.0.1.tgz'
Content type 'application/x-gzip' length 199668 bytes (194 KB)
==================================================
downloaded 194 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/Rfast_2.0.6.tgz'
Content type 'application/x-gzip' length 11725745 bytes (11.2 MB)
==================================================
downloaded 11.2 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/doParallel_1.0.17.tgz'
Content type 'application/x-gzip' length 188349 bytes (183 KB)
==================================================
downloaded 183 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/foreach_1.5.2.tgz'
Content type 'application/x-gzip' length 136295 bytes (133 KB)
==================================================
downloaded 133 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/doRNG_1.8.2.tgz'
Content type 'application/x-gzip' length 279715 bytes (273 KB)
==================================================
downloaded 273 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/gmp_0.6-6.tgz'
Content type 'application/x-gzip' length 871583 bytes (851 KB)
==================================================
downloaded 851 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/Rmpfr_0.8-9.tgz'
Content type 'application/x-gzip' length 1558351 bytes (1.5 MB)
==================================================
downloaded 1.5 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/SuppDists_1.1-9.7.tgz'
Content type 'application/x-gzip' length 347527 bytes (339 KB)
==================================================
downloaded 339 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/kSamples_1.2-9.tgz'
Content type 'application/x-gzip' length 277455 bytes (270 KB)
==================================================
downloaded 270 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/BWStest_0.2.2.tgz'
Content type 'application/x-gzip' length 422680 bytes (412 KB)
==================================================
downloaded 412 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/mnormt_2.1.1.tgz'
Content type 'application/x-gzip' length 211871 bytes (206 KB)
==================================================
downloaded 206 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/commonmark_1.8.1.tgz'
Content type 'application/x-gzip' length 320304 bytes (312 KB)
==================================================
downloaded 312 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/reshape_0.8.9.tgz'
Content type 'application/x-gzip' length 168752 bytes (164 KB)
==================================================
downloaded 164 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/mc2d_0.1-21.tgz'
Content type 'application/x-gzip' length 1378438 bytes (1.3 MB)
==================================================
downloaded 1.3 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/gower_1.0.0.tgz'
Content type 'application/x-gzip' length 165389 bytes (161 KB)
==================================================
downloaded 161 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/hardhat_1.2.0.tgz'
Content type 'application/x-gzip' length 795388 bytes (776 KB)
==================================================
downloaded 776 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/ipred_0.9-13.tgz'
Content type 'application/x-gzip' length 384988 bytes (375 KB)
==================================================
downloaded 375 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/timeDate_4021.106.tgz'
Content type 'application/x-gzip' length 1579983 bytes (1.5 MB)
==================================================
downloaded 1.5 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/correlation_0.8.3.tgz'
Content type 'application/x-gzip' length 2528105 bytes (2.4 MB)
==================================================
downloaded 2.4 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/datawizard_0.6.3.tgz'
Content type 'application/x-gzip' length 1142513 bytes (1.1 MB)
==================================================
downloaded 1.1 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/insight_0.18.6.tgz'
Content type 'application/x-gzip' length 2004384 bytes (1.9 MB)
==================================================
downloaded 1.9 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/paletteer_1.5.0.tgz'
Content type 'application/x-gzip' length 432181 bytes (422 KB)
==================================================
downloaded 422 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/parameters_0.19.0.tgz'
Content type 'application/x-gzip' length 1861775 bytes (1.8 MB)
==================================================
downloaded 1.8 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/performance_0.10.0.tgz'
Content type 'application/x-gzip' length 3061327 bytes (2.9 MB)
==================================================
downloaded 2.9 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/statsExpressions_1.3.4.tgz'
Content type 'application/x-gzip' length 3392521 bytes (3.2 MB)
==================================================
downloaded 3.2 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/afex_1.1-1.tgz'
Content type 'application/x-gzip' length 2492600 bytes (2.4 MB)
==================================================
downloaded 2.4 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/BayesFactor_0.9.12-4.4.tgz'
Content type 'application/x-gzip' length 4278037 bytes (4.1 MB)
==================================================
downloaded 4.1 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/gapminder_0.3.0.tgz'
Content type 'application/x-gzip' length 2031842 bytes (1.9 MB)
==================================================
downloaded 1.9 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/ggcorrplot_0.1.4.tgz'
Content type 'application/x-gzip' length 28610 bytes (27 KB)
==================================================
downloaded 27 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/ggside_0.2.1.tgz'
Content type 'application/x-gzip' length 2954431 bytes (2.8 MB)
==================================================
downloaded 2.8 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/metaBMA_0.6.7.tgz'
Content type 'application/x-gzip' length 19001151 bytes (18.1 MB)
==================================================
downloaded 18.1 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/metafor_3.8-1.tgz'
Content type 'application/x-gzip' length 4479727 bytes (4.3 MB)
==================================================
downloaded 4.3 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/metaplus_1.0-4.tgz'
Content type 'application/x-gzip' length 469895 bytes (458 KB)
==================================================
downloaded 458 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/PMCMRplus_1.9.6.tgz'
Content type 'application/x-gzip' length 1221848 bytes (1.2 MB)
==================================================
downloaded 1.2 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/psych_2.2.9.tgz'
Content type 'application/x-gzip' length 3826607 bytes (3.6 MB)
==================================================
downloaded 3.6 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/spelling_2.2.tgz'
Content type 'application/x-gzip' length 52503 bytes (51 KB)
==================================================
downloaded 51 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/WRS2_1.1-4.tgz'
Content type 'application/x-gzip' length 965147 bytes (942 KB)
==================================================
downloaded 942 KB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/recipes_1.0.2.tgz'
Content type 'application/x-gzip' length 1475076 bytes (1.4 MB)
==================================================
downloaded 1.4 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/ggstatsplot_0.9.5.tgz'
Content type 'application/x-gzip' length 3422071 bytes (3.3 MB)
==================================================
downloaded 3.3 MB
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.2/palmerpenguins_0.1.1.tgz'
Content type 'application/x-gzip' length 3003192 bytes (2.9 MB)
==================================================
downloaded 2.9 MB
The downloaded binary packages are in
/var/folders/r1/3zp0c6w516g61fbl6pqcz7gr0000gn/T//RtmpKhjam5/downloaded_packages
installing the source package ‘lava’
trying URL 'https://cran.rstudio.com/src/contrib/lava_1.7.0.tar.gz'
Content type 'application/x-gzip' length 1106064 bytes (1.1 MB)
==================================================
downloaded 1.1 MB
* installing *source* package ‘lava’ ...
** package ‘lava’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
** demo
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (lava)
The downloaded source packages are in
‘/private/var/folders/r1/3zp0c6w516g61fbl6pqcz7gr0000gn/T/RtmpKhjam5/downloaded_packages’
- summary
summary()
- plot
- Histograms
hist(cats, breaks = "scott")
Error in hist.default(cats, breaks = "scott") : 'x' must be numeric
hist(pedes, breaks= "scott", prob = T)
lines(density(pedes))
Bivariate and Multivariate Statistics
- Plotting and Regression
- Box plotting
